<?php namespace App\Models\Cxhshop;

// use App\Models\Base\CxhshopBase;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Redis; 
class Index extends Model {

    protected $connection='jmft_uc';
    protected $table = 'news_dictionaries';
     /**
     * 根据type查询首页等数据 或者获取redis缓存
     * params1 String $uid
     */
    public function getindex($type) {
        $query = self::query();
        $query =  $query ->select('content')-> where('type', '=', $type);
        $count = $query->first()->count();
        if($count>0){
            $data = $query ->first()-> toArray(); 
            $data['content'] = json_decode($data['content'],true); 
            return $data;
        }else{
            return false;
        }
       
       
    }
   
   
    

}